<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品回购</title>
<link href="${basePath }/css/ui.css" rel="stylesheet" type="text/css">
<jsp:include page="/header.jsp"></jsp:include>
<script type="text/javascript">
	function findItems() {
		$.ajax({
			url:"${basePath}/buyback/findItems.htm",
			type:"post",
			data:$("form").serialize(),
			dataType:"html"
		}).done(function(data){
			$("#list_div").html(data);
		});
	}
	
	function mysubmit() {
		var checks = $("input[name='ids']:checked").map(function(){
			return $(this).val();
		}).get().join("','");
		
		var form = $("<form action='${basePath}/buyback/nocode_buy.htm' method='post'></form>");
		var hidden = $("<input type='hidden' name='ids' value=\"'"+checks+"'\">");
		form.append(hidden);
		form.submit();
	}
	
</script>
</head>
<body>
    <div class="main">
        <div class="cont">
            <h2 class="title">回购商品信息：</h2>
            <div class="ui">
            	<form>
                <div class="label_box">
                	<span class="sel_label fl">商品回购类型：
                		<input type="radio" name="back_type" checked="checked" value="1">退货&nbsp;
						<input type="radio" name="back_type" value="2">回购
                	</span>
                	<a href="${basePath }/buyback/index.htm" >扫描回购商品</a>
                </div>
                <div class="label_box">
                    <span class="sel_label fl">客户名称：</span>
                    <input type="text" name="name" class="text_input fl">
                    <span class="sel_label fl">手机号：</span>
                    <input type="text" name="tel" class="text_input fl">
                    <span class="sel_label fl">购买时间：</span>
                    <select name="year">
                    	<option value=''>全部</option>
                    	<option value='2015'>2015</option>
                    	<option value='2014'>2014</option>
                    	<option value='2013'>2013</option>
                    	<option value='2012'>2012</option>
                    	<option value='2011'>2011</option>
                    	<option value='2010'>2010</option>
                    </select>
                    <input type="button" value="查找" onclick="findItems();">
                </div>
                </form>
            </div>
            <h2 class="title"> 历次交易信息：</h2>
            <div id="list_div">
            </div>
            
            <div class="text_c">
	        	<a href="javascript:;" class="yellow_btn btn" onclick="mysubmit();">提交</a>
	        </div>
            
        </div>
    </div>

</body>
</html>